'use strict';
var calculate_average = function(collection){
    let arr1=new Array();
  for(let i=0;i<collection.length;i++){
    if(collection[i]%2==0){
      arr1.push(collection[i]);
    }
  }
  let sum=0;
  for(let i=0;i<arr1.length;i++){
    sum=sum+arr1[i];
  }
  let result=sum/arr1.length;
  return result;
};
module.exports = calculate_average;
